#!/bin/sh

TEMP_FILE=$(mktemp -p ${PWD} plotter.XXXXXXXXXX) && {
    
    ./test-filter-cosinusoid ${@} > ${TEMP_FILE}
    
    gnuplot <<_EOF
set terminal jpeg
set output "${TEMP_FILE}.jpeg"
set title "Filtered Noisy Cosinusoid Signal"
set zero 1e-11
set yrange [-0.5:0.5]
plot [0:511] "${TEMP_FILE}" using 1:2 title "Noisy Cosinusoid" lt rgb "blue" with l
_EOF

    rm -f "${TEMP_FILE}"
}
